class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: H = None
        self.s: H = None
        self.v: A = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: G = None
        self.x: E = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: B = None
        self.p: B = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.v: E = None
        self.p: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: C = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

g = A("g")
m = B("m")
n = C("n")
f = D("f")
b = E("b")
d = F("d")
j = G("j")
e = H("e")

g.u = e
g.p = b
m.r = g
m.v = g
m.w = e
m.s = e
m.t = d
n.v = m
n.r = j
n.x = b
n.y = f
f.r = b
f.s = m
f.p = m
f.w = m
f.t = g
b.x = j
d.x = n
d.s = g
d.v = b
d.p = f
d.z = j
j.z = e
j.p = e
j.r = n
e.u = j
assert n.r.r.y.t.p.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: H = None
        self.s: H = None
        self.v: A = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: G = None
        self.x: E = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: B = None
        self.p: B = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.v: E = None
        self.p: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: C = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

g = A("g")
m = B("m")
n = C("n")
f = D("f")
b = E("b")
d = F("d")
j = G("j")
e = H("e")

g.u = e
g.p = b
m.r = g
m.v = g
m.w = e
m.s = e
m.t = d
n.v = m
n.r = j
n.x = b
n.y = f
f.r = b
f.s = m
f.p = m
f.w = m
f.t = g
b.x = j
d.x = n
d.s = g
d.v = b
d.p = f
d.z = j
j.z = e
j.p = e
j.r = n
e.u = j
assert n.r.r.y.t.p.x.z.txt == "e"