class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: H = None
        self.p: H = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

b = A("b")
d = B("d")
m = C("m")
l = D("l")
i = E("i")
k = F("k")
f = G("f")
h = H("h")
c = G("c")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: D = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

b = A("b")
d = B("d")
m = C("m")
l = D("l")
i = E("i")
k = F("k")
f = G("f")
h = H("h")
c = G("c")

b.r = l
b.z = h
b.p = h
b.y = i
b.s = d
d.y = m
d.x = k
m.x = i
l.o = f
l.y = m
i.z = l
i.o = b
i.u = k
k.s = m
k.y = m
k.u = b
k.z = l
k.o = i
f.v = k
f.u = l
f.x = c
f.q = m
h.t = i
c.v = k
c.u = l
c.x = f
c.q = m
assert l.o.u.y.x.u.y.x.txt == "i"