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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: A = None
        self.v: A = None
        self.o: B = None
        self.y: E = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: C = None
        self.q: A = None
        self.y: D = None
        self.o: D = None
        self.r: C = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.txt = txt

h = A("h")
l = B("l")
c = C("c")
e = D("e")
m = E("m")
b = F("b")
d = G("d")

h.p = c
h.r = c
h.s = b
l.q = d
l.w = e
c.t = b
c.x = b
c.s = h
c.v = h
c.o = l
c.y = m
c.q = e
e.z = l
e.s = l
e.r = b
e.o = h
e.q = d
e.t = m
m.x = d
m.u = c
m.r = c
m.q = h
m.w = h
m.y = e
m.o = e
b.s = h
b.w = h
b.v = c
d.t = c
d.w = e
assert b.w.p.y.u.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: A = None
        self.v: A = None
        self.o: B = None
        self.y: E = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: C = None
        self.q: A = None
        self.y: D = None
        self.o: D = None
        self.r: C = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.txt = txt

h = A("h")
l = B("l")
c = C("c")
e = D("e")
m = E("m")
b = F("b")
d = G("d")

h.p = c
h.r = c
h.s = b
l.q = d
l.w = e
c.t = b
c.x = b
c.s = h
c.v = h
c.o = l
c.y = m
c.q = e
e.z = l
e.s = l
e.r = b
e.o = h
e.q = d
e.t = m
m.x = d
m.u = c
m.r = c
m.q = h
m.w = h
m.y = e
m.o = e
b.s = h
b.w = h
b.v = c
d.t = c
d.w = e
assert b.w.p.y.u.o.w.txt == "e"