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

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

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

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

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

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

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

m.p = i
m.q = d
m.r = f
m.z = c
k.s = b
k.p = j
k.v = g
b.r = d
b.z = k
b.s = c
d.w = k
d.p = k
h.v = k
h.r = j
h.w = c
c.v = d
c.y = d
c.r = g
g.s = b
g.p = j
g.v = k
j.p = d
j.q = d
j.r = h
j.z = c
f.v = k
f.r = m
f.w = c
i.w = g
i.p = g
assert k.v.s.z.v.s.z.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

m.p = i
m.q = d
m.r = f
m.z = c
k.s = b
k.p = j
k.v = g
b.r = d
b.z = k
b.s = c
d.w = k
d.p = k
h.v = k
h.r = j
h.w = c
c.v = d
c.y = d
c.r = g
g.s = b
g.p = j
g.v = k
j.p = d
j.q = d
j.r = h
j.z = c
f.v = k
f.r = m
f.w = c
i.w = g
i.p = g
assert k.v.s.z.v.s.z.v.p.txt == "j"