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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.o: A = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

l.q = g
l.r = i
l.o = k
i.z = l
i.t = g
i.q = h
h.x = l
h.q = l
h.o = l
h.u = k
h.v = c
g.w = f
g.x = i
g.o = i
n.q = l
n.o = l
n.v = g
c.t = b
a.w = f
a.x = i
a.o = i
k.t = n
b.q = l
b.o = l
b.v = g
f.t = b
assert f.t.o.o.t.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.o: A = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

l.q = g
l.r = i
l.o = k
i.z = l
i.t = g
i.q = h
h.x = l
h.q = l
h.o = l
h.u = k
h.v = c
g.w = f
g.x = i
g.o = i
n.q = l
n.o = l
n.v = g
c.t = b
a.w = f
a.x = i
a.o = i
k.t = n
b.q = l
b.o = l
b.v = g
f.t = b
assert f.t.o.o.t.o.r.txt == "i"