class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.v: D = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: C = None
        self.t: F = None
        self.u: H = None
        self.s: G = None
        self.r: B = None
        self.o: A = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

i = A("i")
j = B("j")
l = C("l")
a = D("a")
e = E("e")
g = F("g")
f = G("f")
d = H("d")
b = I("b")

i.p = a
i.v = a
j.o = g
j.v = a
l.s = a
a.t = d
a.o = l
e.x = f
g.w = i
g.r = d
g.v = a
g.x = l
f.p = d
f.y = l
d.w = e
d.s = e
d.q = g
b.v = g
b.t = g
b.z = l
b.u = d
b.s = f
b.r = j
b.o = i
b.y = i
b.x = e
assert f.p.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.v: D = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: E = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: C = None
        self.t: F = None
        self.u: H = None
        self.s: G = None
        self.r: B = None
        self.o: A = None
        self.y: A = None
        self.x: E = None
        self.txt = txt

i = A("i")
j = B("j")
l = C("l")
a = D("a")
e = E("e")
g = F("g")
f = G("f")
d = H("d")
b = I("b")

i.p = a
i.v = a
j.o = g
j.v = a
l.s = a
a.t = d
a.o = l
e.x = f
g.w = i
g.r = d
g.v = a
g.x = l
f.p = d
f.y = l
d.w = e
d.s = e
d.q = g
b.v = g
b.t = g
b.z = l
b.u = d
b.s = f
b.r = j
b.o = i
b.y = i
b.x = e
assert f.p.q.w.txt == "i"