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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: F = None
        self.t: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

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