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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.o: E = None
        self.w: F = None
        self.s: E = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: D = None
        self.o: E = None
        self.w: F = None
        self.s: E = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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