class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: F = None
        self.z: G = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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