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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.o: B = None
        self.p: B = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.o: B = None
        self.p: B = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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