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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.u: G = None
        self.w: E = None
        self.s: H = None
        self.v: D = None
        self.x: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: G = None
        self.x: H = None
        self.w: D = None
        self.y: I = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.u: G = None
        self.w: E = None
        self.s: H = None
        self.v: D = None
        self.x: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: G = None
        self.x: H = None
        self.w: D = None
        self.y: I = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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