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

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

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

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

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

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

d = A("d")
i = B("i")
m = C("m")
k = D("k")
l = E("l")
h = F("h")
c = C("c")
j = F("j")

d.p = k
d.u = h
d.z = i
i.p = h
i.w = h
i.q = j
i.v = d
m.w = l
m.o = l
m.y = k
m.v = i
m.z = d
k.q = h
k.r = d
k.z = i
k.v = l
l.p = d
l.v = i
l.q = c
h.r = k
h.p = k
h.o = i
h.q = d
h.y = m
c.w = l
c.o = l
c.y = k
c.v = i
c.z = d
j.r = k
j.p = k
j.o = i
j.q = d
j.y = c
assert m.z.p.v.q.y.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

d = A("d")
i = B("i")
m = C("m")
k = D("k")
l = E("l")
h = F("h")
c = C("c")
j = F("j")

d.p = k
d.u = h
d.z = i
i.p = h
i.w = h
i.q = j
i.v = d
m.w = l
m.o = l
m.y = k
m.v = i
m.z = d
k.q = h
k.r = d
k.z = i
k.v = l
l.p = d
l.v = i
l.q = c
h.r = k
h.p = k
h.o = i
h.q = d
h.y = m
c.w = l
c.o = l
c.y = k
c.v = i
c.z = d
j.r = k
j.p = k
j.o = i
j.q = d
j.y = c
assert m.z.p.v.q.y.r.p.txt == "k"