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

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

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

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

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

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

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

m.q = l
m.r = f
m.z = b
m.u = b
m.t = e
n.v = m
f.r = h
f.y = n
h.s = f
b.r = n
e.r = h
l.q = m
l.r = f
l.z = b
l.u = b
l.t = e
assert n.v.t.r.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.z: E = None
        self.t: F = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

m.q = l
m.r = f
m.z = b
m.u = b
m.t = e
n.v = m
f.r = h
f.y = n
h.s = f
b.r = n
e.r = h
l.q = m
l.r = f
l.z = b
l.u = b
l.t = e
assert n.v.t.r.s.y.txt == "n"