class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.v: B = None
        self.w: C = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.q: F = None
        self.y: H = None
        self.s: F = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

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

k = A("k")
h = B("h")
g = C("g")
f = D("f")
i = E("i")
n = F("n")
l = G("l")
e = H("e")
c = F("c")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.q: F = None
        self.y: H = None
        self.s: F = None
        self.v: F = None
        self.t: B = None
        self.txt = txt

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

k = A("k")
h = B("h")
g = C("g")
f = D("f")
i = E("i")
n = F("n")
l = G("l")
e = H("e")
c = F("c")
m = H("m")

k.p = f
k.u = h
k.v = h
k.w = g
k.x = e
h.x = k
h.t = i
g.r = e
f.o = g
f.p = i
f.y = e
i.o = k
n.v = i
n.y = l
n.s = l
n.w = h
l.w = f
l.x = h
l.t = h
l.q = c
l.s = c
l.v = c
l.y = e
e.v = f
e.r = i
e.y = i
e.o = m
e.s = l
e.p = l
c.v = i
c.y = l
c.s = l
c.w = h
m.v = f
m.r = i
m.y = i
m.o = e
m.s = l
m.p = l
assert m.v.o.r.txt == "e"