class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: B = None
        self.s: E = None
        self.v: E = None
        self.y: B = None
        self.r: H = None
        self.o: F = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: E = None
        self.u: A = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
d = C("d")
e = D("e")
c = E("c")
k = F("k")
n = G("n")
h = H("h")

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: E = None
        self.u: A = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
d = C("d")
e = D("e")
c = E("c")
k = F("k")
n = G("n")
h = H("h")

f.u = h
f.r = h
f.p = j
f.y = j
f.z = j
f.s = c
f.v = c
f.o = k
j.v = n
j.o = n
j.z = d
d.v = h
e.y = n
e.z = d
e.u = k
e.q = k
c.r = d
k.p = c
k.o = c
k.u = f
k.v = f
k.s = d
n.t = e
n.x = f
h.y = d
h.r = j
h.v = j
h.z = j
h.w = e
assert j.o.t.u.o.r.v.w.txt == "e"