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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.y: B = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.q: D = None
        self.v: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: E = None
        self.y: B = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.q: D = None
        self.v: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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