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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.x: C = None
        self.r: C = None
        self.p: A = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

l = A("l")
j = B("j")
i = C("i")
e = D("e")
b = E("b")
c = F("c")
d = C("d")
h = F("h")

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.x: C = None
        self.r: C = None
        self.p: A = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.s: F = None
        self.txt = txt

l = A("l")
j = B("j")
i = C("i")
e = D("e")
b = E("b")
c = F("c")
d = C("d")
h = F("h")

l.r = d
l.p = d
l.q = h
l.y = j
l.u = j
j.w = e
j.v = l
i.w = j
i.t = j
i.x = d
i.r = d
i.p = l
i.z = e
e.x = h
b.o = e
c.v = h
c.s = h
c.z = e
d.w = j
d.t = j
d.x = i
d.r = i
d.p = l
d.z = e
h.v = c
h.s = c
h.z = e
assert i.w.w.x.s.s.txt == "h"