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

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

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

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

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

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

g = A("g")
m = B("m")
a = C("a")
l = D("l")
d = E("d")
k = F("k")
j = A("j")
b = D("b")

g.p = d
g.x = b
g.q = j
g.r = j
g.w = k
m.r = l
a.o = k
a.z = j
l.x = m
l.v = m
l.t = a
l.o = a
l.w = b
l.s = j
d.t = m
d.s = j
d.p = j
d.y = l
k.u = m
j.p = d
j.x = l
j.q = g
j.r = g
j.w = k
b.x = m
b.v = m
b.t = a
b.o = a
b.w = l
b.s = g
assert m.r.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.q: A = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

g = A("g")
m = B("m")
a = C("a")
l = D("l")
d = E("d")
k = F("k")
j = A("j")
b = D("b")

g.p = d
g.x = b
g.q = j
g.r = j
g.w = k
m.r = l
a.o = k
a.z = j
l.x = m
l.v = m
l.t = a
l.o = a
l.w = b
l.s = j
d.t = m
d.s = j
d.p = j
d.y = l
k.u = m
j.p = d
j.x = l
j.q = g
j.r = g
j.w = k
b.x = m
b.v = m
b.t = a
b.o = a
b.w = l
b.s = g
assert m.r.w.v.txt == "m"