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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: D = None
        self.q: D = None
        self.o: F = None
        self.r: H = None
        self.v: G = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: E = None
        self.s: A = None
        self.y: E = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: D = None
        self.q: D = None
        self.o: F = None
        self.r: H = None
        self.v: G = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: E = None
        self.s: A = None
        self.y: E = None
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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