class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: G = None
        self.z: F = None
        self.t: C = None
        self.p: H = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: G = None
        self.w: B = None
        self.y: F = None
        self.r: A = None
        self.s: D = None
        self.x: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: G = None
        self.w: B = None
        self.y: F = None
        self.r: A = None
        self.s: D = None
        self.x: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.r: E = None
        self.x: D = None
        self.txt = txt

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

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