class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.q: C = None
        self.t: G = None
        self.w: C = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: I = None
        self.t: H = None
        self.u: G = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: I = None
        self.x: I = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.o: B = None
        self.w: I = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.q: C = None
        self.t: G = None
        self.w: C = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: I = None
        self.t: H = None
        self.u: G = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: I = None
        self.x: I = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: C = None
        self.o: B = None
        self.w: I = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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