class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.x: C = None
        self.s: C = None
        self.t: C = None
        self.o: G = None
        self.q: B = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.p: C = None
        self.y: A = None
        self.q: A = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: F = None
        self.v: G = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.q: E = None
        self.s: B = None
        self.o: D = None
        self.y: B = 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.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.p: C = None
        self.y: A = None
        self.q: A = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: F = None
        self.v: G = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: B = None
        self.q: E = None
        self.s: B = None
        self.o: D = None
        self.y: B = 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.z: B = None
        self.txt = txt

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

n.r = j
n.v = m
n.x = m
n.s = m
n.t = m
n.o = h
n.y = h
n.q = f
g.v = j
g.w = j
g.z = f
g.p = m
g.y = n
g.q = n
g.x = e
m.r = b
m.p = n
j.y = h
j.v = h
j.z = e
j.s = g
l.q = e
l.v = e
l.p = e
l.t = g
e.p = n
e.w = g
e.s = g
e.q = l
e.o = j
e.y = f
h.r = j
b.z = f
f.v = j
f.w = j
f.z = g
f.p = m
f.y = n
f.q = n
f.x = e
assert f.z.x.p.txt == "n"