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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: G = None
        self.t: G = None
        self.q: A = None
        self.w: E = None
        self.p: E = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: B = None
        self.p: B = None
        self.u: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: F = None
        self.p: C = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: G = None
        self.t: G = None
        self.q: A = None
        self.w: E = None
        self.p: E = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: B = None
        self.p: B = None
        self.u: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: F = None
        self.p: C = None
        self.y: A = None
        self.q: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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