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

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

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

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

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

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

b = A("b")
g = B("g")
n = C("n")
e = D("e")
i = E("i")
j = F("j")
l = F("l")
m = F("m")

b.t = m
b.q = n
b.o = n
b.r = e
g.v = m
n.r = g
n.p = e
n.s = i
e.x = b
e.t = n
e.y = i
e.w = i
e.z = j
i.x = b
i.r = e
i.t = g
j.r = n
j.o = n
j.w = g
j.s = e
j.x = b
l.r = n
l.o = n
l.w = g
l.s = e
l.x = b
m.r = n
m.o = n
m.w = g
m.s = e
m.x = b
assert l.w.v.x.q.r.v.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

b = A("b")
g = B("g")
n = C("n")
e = D("e")
i = E("i")
j = F("j")
l = F("l")
m = F("m")

b.t = m
b.q = n
b.o = n
b.r = e
g.v = m
n.r = g
n.p = e
n.s = i
e.x = b
e.t = n
e.y = i
e.w = i
e.z = j
i.x = b
i.r = e
i.t = g
j.r = n
j.o = n
j.w = g
j.s = e
j.x = b
l.r = n
l.o = n
l.w = g
l.s = e
l.x = b
m.r = n
m.o = n
m.w = g
m.s = e
m.x = b
assert l.w.v.x.q.r.v.w.v.txt == "m"