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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.s: C = None
        self.r: C = None
        self.txt = txt

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

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

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

f.r = l
b.t = g
b.q = g
b.p = g
b.r = f
b.u = f
b.o = f
g.p = l
h.z = l
h.x = j
h.s = g
h.r = g
l.r = g
j.t = l
j.s = l
j.r = l
j.o = f
j.w = f
j.z = f
assert b.t.p.r.p.txt == "l"