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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.y: C = None
        self.s: C = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.y: C = None
        self.s: C = None
        self.o: D = None
        self.txt = txt

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

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