class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.q: A = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.r: B = None
        self.p: C = None
        self.s: B = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
b = C("b")
j = D("j")
e = E("e")
h = F("h")
f = D("f")
a = A("a")
c = A("c")

g.u = i
g.o = b
g.q = c
g.r = f
g.t = e
i.p = h
i.x = g
b.r = f
b.o = f
j.x = h
j.z = e
j.r = i
j.s = i
j.p = b
e.u = h
e.s = h
e.q = g
h.u = i
h.y = b
h.v = f
f.x = h
f.z = e
f.r = i
f.s = i
f.p = b
a.u = i
a.o = b
a.q = g
a.r = f
a.t = e
c.u = i
c.o = b
c.q = a
c.r = f
c.t = e
assert e.u.v.p.o.z.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.q: A = None
        self.r: D = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.r: B = None
        self.p: C = None
        self.s: B = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
b = C("b")
j = D("j")
e = E("e")
h = F("h")
f = D("f")
a = A("a")
c = A("c")

g.u = i
g.o = b
g.q = c
g.r = f
g.t = e
i.p = h
i.x = g
b.r = f
b.o = f
j.x = h
j.z = e
j.r = i
j.s = i
j.p = b
e.u = h
e.s = h
e.q = g
h.u = i
h.y = b
h.v = f
f.x = h
f.z = e
f.r = i
f.s = i
f.p = b
a.u = i
a.o = b
a.q = g
a.r = f
a.t = e
c.u = i
c.o = b
c.q = a
c.r = f
c.t = e
assert e.u.v.p.o.z.q.q.txt == "c"