class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: F = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.p: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

k = A("k")
i = B("i")
g = C("g")
l = D("l")
e = E("e")
b = F("b")
a = G("a")
f = H("f")
c = A("c")
m = C("m")

k.p = i
k.o = b
k.t = e
i.q = b
g.y = b
g.z = i
g.p = c
g.u = e
l.z = i
l.t = i
l.p = i
l.o = g
e.v = a
e.w = m
b.u = a
b.w = a
b.s = a
b.o = f
a.p = f
a.o = c
f.o = l
f.u = g
c.p = i
c.o = b
c.t = e
m.y = b
m.z = i
m.p = k
m.u = e
assert i.q.o.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: F = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.p: A = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

k = A("k")
i = B("i")
g = C("g")
l = D("l")
e = E("e")
b = F("b")
a = G("a")
f = H("f")
c = A("c")
m = C("m")

k.p = i
k.o = b
k.t = e
i.q = b
g.y = b
g.z = i
g.p = c
g.u = e
l.z = i
l.t = i
l.p = i
l.o = g
e.v = a
e.w = m
b.u = a
b.w = a
b.s = a
b.o = f
a.p = f
a.o = c
f.o = l
f.u = g
c.p = i
c.o = b
c.t = e
m.y = b
m.z = i
m.p = k
m.u = e
assert i.q.o.u.z.txt == "i"