class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.u: C = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.p: C = None
        self.u: F = None
        self.v: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.v: A = None
        self.txt = txt

f = A("f")
j = B("j")
a = C("a")
m = D("m")
g = E("g")
e = F("e")
k = G("k")
b = H("b")
h = C("h")

f.q = m
f.o = j
j.p = f
j.w = a
j.x = g
j.q = g
j.y = b
j.t = h
j.z = k
a.q = h
a.u = h
a.r = h
a.o = e
a.p = b
m.y = k
m.r = b
m.v = b
m.p = a
m.u = e
g.u = m
g.z = k
g.x = f
g.p = b
e.u = j
k.v = m
k.z = a
k.r = f
b.o = m
b.t = g
b.v = f
h.q = a
h.u = a
h.r = a
h.o = e
h.p = b
assert g.p.o.u.u.q.p.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.u: C = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.p: C = None
        self.u: F = None
        self.v: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: E = None
        self.v: A = None
        self.txt = txt

f = A("f")
j = B("j")
a = C("a")
m = D("m")
g = E("g")
e = F("e")
k = G("k")
b = H("b")
h = C("h")

f.q = m
f.o = j
j.p = f
j.w = a
j.x = g
j.q = g
j.y = b
j.t = h
j.z = k
a.q = h
a.u = h
a.r = h
a.o = e
a.p = b
m.y = k
m.r = b
m.v = b
m.p = a
m.u = e
g.u = m
g.z = k
g.x = f
g.p = b
e.u = j
k.v = m
k.z = a
k.r = f
b.o = m
b.t = g
b.v = f
h.q = a
h.u = a
h.r = a
h.o = e
h.p = b
assert g.p.o.u.u.q.p.t.x.txt == "f"