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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.u: A = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

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

b.r = j
b.q = e
j.w = l
j.p = e
j.t = a
e.q = i
e.x = i
e.w = a
i.w = a
i.y = a
i.q = a
i.x = l
i.p = e
a.p = l
a.u = l
a.r = l
a.x = i
l.s = i
l.p = i
l.u = b
l.v = b
l.q = e
assert a.x.x.v.r.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.u: A = None
        self.q: C = None
        self.v: A = None
        self.txt = txt

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

b.r = j
b.q = e
j.w = l
j.p = e
j.t = a
e.q = i
e.x = i
e.w = a
i.w = a
i.y = a
i.q = a
i.x = l
i.p = e
a.p = l
a.u = l
a.r = l
a.x = i
l.s = i
l.p = i
l.u = b
l.v = b
l.q = e
assert a.x.x.v.r.p.x.txt == "i"