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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.z: G = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

b.r = a
b.y = j
a.r = n
a.z = f
a.p = i
n.v = h
n.w = i
i.v = h
i.y = b
i.t = j
h.s = l
h.x = e
h.o = a
h.y = b
j.o = h
j.w = k
k.s = a
k.q = j
k.y = j
k.t = i
k.r = l
e.r = f
e.v = f
e.z = k
e.s = j
e.p = i
l.r = n
l.z = f
l.p = i
f.v = h
f.w = i
assert i.y.y.w.y.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.z: G = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

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