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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.o: B = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.r: E = None
        self.w: D = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

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

b = A("b")
m = B("m")
f = C("f")
c = D("c")
e = E("e")
k = F("k")
n = E("n")
g = C("g")
h = D("h")
i = E("i")

b.u = g
b.x = h
m.w = f
m.x = k
m.u = k
m.r = c
m.v = g
f.z = g
f.p = b
f.o = m
f.q = m
c.q = m
c.z = m
c.s = b
c.r = i
c.w = h
e.q = b
e.r = b
e.v = k
k.u = m
k.x = e
n.q = b
n.r = b
n.v = k
g.z = f
g.p = b
g.o = m
g.q = m
h.q = m
h.z = m
h.s = b
h.r = e
h.w = c
i.q = b
i.r = b
i.v = k
assert g.z.z.q.w.o.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.o: B = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.r: E = None
        self.w: D = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

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

b = A("b")
m = B("m")
f = C("f")
c = D("c")
e = E("e")
k = F("k")
n = E("n")
g = C("g")
h = D("h")
i = E("i")

b.u = g
b.x = h
m.w = f
m.x = k
m.u = k
m.r = c
m.v = g
f.z = g
f.p = b
f.o = m
f.q = m
c.q = m
c.z = m
c.s = b
c.r = i
c.w = h
e.q = b
e.r = b
e.v = k
k.u = m
k.x = e
n.q = b
n.r = b
n.v = k
g.z = f
g.p = b
g.o = m
g.q = m
h.q = m
h.z = m
h.s = b
h.r = e
h.w = c
i.q = b
i.r = b
i.v = k
assert g.z.z.q.w.o.u.u.txt == "m"