class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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