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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.v: C = None
        self.t: F = None
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: B = None
        self.v: C = None
        self.t: F = None
        self.y: B = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.txt = txt

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

e.u = h
e.v = g
e.x = n
e.p = k
h.z = f
h.y = c
c.y = h
c.s = a
k.r = c
g.q = n
g.t = n
g.s = h
g.y = h
g.v = c
g.p = a
n.x = g
n.v = e
n.q = e
n.u = e
n.r = e
a.q = n
a.z = g
f.r = c
assert h.y.y.z.r.s.z.txt == "g"