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

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

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

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

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

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

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

d.z = n
d.w = h
d.r = g
d.y = f
d.u = f
d.p = m
m.s = n
l.v = f
l.r = h
f.v = m
n.p = l
h.x = g
h.r = l
h.w = c
h.y = m
h.p = n
h.s = n
g.v = f
g.r = h
c.z = n
c.w = h
c.r = l
c.y = f
c.u = f
c.p = m
assert n.p.v.v.s.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.r: C = None
        self.y: D = None
        self.u: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

d.z = n
d.w = h
d.r = g
d.y = f
d.u = f
d.p = m
m.s = n
l.v = f
l.r = h
f.v = m
n.p = l
h.x = g
h.r = l
h.w = c
h.y = m
h.p = n
h.s = n
g.v = f
g.r = h
c.z = n
c.w = h
c.r = l
c.y = f
c.u = f
c.p = m
assert n.p.v.v.s.p.r.txt == "h"