class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: H = None
        self.p: E = None
        self.t: D = None
        self.s: E = None
        self.u: H = None
        self.v: I = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: E = None
        self.x: E = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.z: A = None
        self.u: A = None
        self.o: D = None
        self.y: F = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: H = None
        self.p: E = None
        self.t: D = None
        self.s: E = None
        self.u: H = None
        self.v: I = None
        self.o: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: E = None
        self.x: E = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: G = None
        self.z: A = None
        self.u: A = None
        self.o: D = None
        self.y: F = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: G = None
        self.txt = txt

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

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