class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.v: B = None
        self.y: B = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.s: F = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

e = A("e")
h = B("h")
j = C("j")
d = D("d")
f = E("f")
a = F("a")
m = B("m")
n = A("n")

e.p = m
e.o = n
e.x = n
e.v = h
e.y = h
h.v = f
h.w = j
h.s = a
h.u = a
h.t = d
j.z = a
j.p = d
d.r = a
f.w = n
a.s = d
a.x = d
a.v = d
m.v = f
m.w = j
m.s = a
m.u = a
m.t = d
n.p = m
n.o = e
n.x = e
n.v = h
n.y = h
assert h.w.p.r.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.v: B = None
        self.y: B = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: C = None
        self.s: F = None
        self.u: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

e = A("e")
h = B("h")
j = C("j")
d = D("d")
f = E("f")
a = F("a")
m = B("m")
n = A("n")

e.p = m
e.o = n
e.x = n
e.v = h
e.y = h
h.v = f
h.w = j
h.s = a
h.u = a
h.t = d
j.z = a
j.p = d
d.r = a
f.w = n
a.s = d
a.x = d
a.v = d
m.v = f
m.w = j
m.s = a
m.u = a
m.t = d
n.p = m
n.o = e
n.x = e
n.v = h
n.y = h
assert h.w.p.r.x.r.txt == "a"