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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.txt = txt

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

l.r = c
l.t = a
l.q = j
j.y = i
j.s = i
n.o = j
n.u = j
n.q = i
n.x = e
n.w = k
i.w = j
i.o = n
k.q = a
k.y = n
e.w = a
e.z = l
f.q = a
f.y = n
c.w = j
c.o = g
g.o = j
g.u = j
g.q = c
g.x = e
g.w = f
a.w = e
a.z = l
assert f.y.w.q.txt == "a"