class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: D = None
        self.u: F = None
        self.y: I = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: F = None
        self.t: G = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: A = None
        self.r: H = None
        self.p: D = None
        self.s: A = None
        self.q: H = None
        self.t: B = None
        self.z: G = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.y: I = None
        self.p: G = None
        self.q: D = None
        self.u: D = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: F = None
        self.t: G = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: A = None
        self.r: H = None
        self.p: D = None
        self.s: A = None
        self.q: H = None
        self.t: B = None
        self.z: G = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: B = None
        self.y: I = None
        self.p: G = None
        self.q: D = None
        self.u: D = None
        self.o: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

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