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

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

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

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

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

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

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

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

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

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

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

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

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

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

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