class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: C = None
        self.z: A = None
        self.r: B = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

e = A("e")
h = B("h")
g = C("g")
a = D("a")
c = E("c")
l = F("l")
d = D("d")
i = A("i")
b = C("b")
k = A("k")

e.o = b
e.r = b
e.x = c
h.o = l
g.y = a
g.v = c
a.u = h
a.y = h
c.t = h
c.p = l
l.q = e
l.x = g
l.z = k
l.r = h
l.w = c
l.u = c
d.u = h
d.y = h
i.o = b
i.r = g
i.x = c
b.y = d
b.v = c
k.o = b
k.r = g
k.x = c
assert h.o.w.p.z.o.y.u.o.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: C = None
        self.z: A = None
        self.r: B = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

e = A("e")
h = B("h")
g = C("g")
a = D("a")
c = E("c")
l = F("l")
d = D("d")
i = A("i")
b = C("b")
k = A("k")

e.o = b
e.r = b
e.x = c
h.o = l
g.y = a
g.v = c
a.u = h
a.y = h
c.t = h
c.p = l
l.q = e
l.x = g
l.z = k
l.r = h
l.w = c
l.u = c
d.u = h
d.y = h
i.o = b
i.r = g
i.x = c
b.y = d
b.v = c
k.o = b
k.r = g
k.x = c
assert h.o.w.p.z.o.y.u.o.x.v.txt == "c"