class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.w: G = None
        self.p: C = None
        self.u: A = None
        self.o: H = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: H = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.w: G = None
        self.p: C = None
        self.u: A = None
        self.o: H = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: H = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

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

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