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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.x: G = None
        self.t: E = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

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

h = A("h")
c = B("c")
e = C("e")
l = D("l")
g = E("g")
a = F("a")
k = G("k")

h.p = l
h.o = c
h.z = a
c.r = h
e.p = c
e.z = g
l.y = k
g.u = c
g.v = a
g.s = a
g.r = k
g.x = h
a.r = h
a.u = g
a.t = g
a.x = k
a.v = l
a.z = l
k.z = e
k.w = l
k.t = a
assert l.y.z.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: B = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: E = None
        self.x: G = None
        self.t: E = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

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

h = A("h")
c = B("c")
e = C("e")
l = D("l")
g = E("g")
a = F("a")
k = G("k")

h.p = l
h.o = c
h.z = a
c.r = h
e.p = c
e.z = g
l.y = k
g.u = c
g.v = a
g.s = a
g.r = k
g.x = h
a.r = h
a.u = g
a.t = g
a.x = k
a.v = l
a.z = l
k.z = e
k.w = l
k.t = a
assert l.y.z.p.r.txt == "h"