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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
h = C("h")
k = D("k")
n = E("n")
e = F("e")
b = F("b")

m.r = h
l.s = b
l.x = n
l.w = n
l.u = n
l.q = m
l.r = h
h.o = l
k.q = l
n.p = k
n.t = m
n.y = m
n.w = e
e.v = n
e.x = h
e.w = b
b.v = n
b.x = h
b.w = e
assert b.w.v.y.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

m = A("m")
l = B("l")
h = C("h")
k = D("k")
n = E("n")
e = F("e")
b = F("b")

m.r = h
l.s = b
l.x = n
l.w = n
l.u = n
l.q = m
l.r = h
h.o = l
k.q = l
n.p = k
n.t = m
n.y = m
n.w = e
e.v = n
e.x = h
e.w = b
b.v = n
b.x = h
b.w = e
assert b.w.v.y.r.o.txt == "l"