class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

d = A("d")
f = B("f")
e = C("e")
b = D("b")
l = E("l")
a = F("a")
j = A("j")

d.t = a
d.y = e
d.u = j
f.t = l
e.u = j
e.w = f
e.r = l
b.r = d
b.v = a
b.t = f
b.q = f
l.s = a
l.q = a
l.o = e
a.q = b
a.y = l
a.o = l
a.s = l
j.t = a
j.y = e
j.u = d
assert f.t.s.y.o.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

d = A("d")
f = B("f")
e = C("e")
b = D("b")
l = E("l")
a = F("a")
j = A("j")

d.t = a
d.y = e
d.u = j
f.t = l
e.u = j
e.w = f
e.r = l
b.r = d
b.v = a
b.t = f
b.q = f
l.s = a
l.q = a
l.o = e
a.q = b
a.y = l
a.o = l
a.s = l
j.t = a
j.y = e
j.u = d
assert f.t.s.y.o.r.o.txt == "e"