class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.o: F = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.x: D = None
        self.q: A = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.x: D = None
        self.q: A = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.txt = txt

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

l.w = g
l.u = g
l.o = n
l.z = d
e.v = g
g.p = d
g.s = d
g.r = l
g.q = l
g.x = f
f.r = n
f.z = l
f.v = m
d.y = l
d.r = g
n.q = l
n.t = m
m.q = l
m.t = n
h.v = g
assert l.o.t.q.w.x.v.t.txt == "n"