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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.u: F = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.o: B = None
        self.z: C = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.txt = txt

b = A("b")
k = B("k")
e = C("e")
d = D("d")
j = E("j")
i = F("i")
f = G("f")
n = A("n")

b.y = k
b.p = d
b.o = j
b.r = n
k.v = i
k.s = i
k.u = i
k.o = i
k.r = n
e.w = f
d.u = k
d.o = k
d.v = f
d.z = e
d.q = i
d.r = n
j.q = n
j.r = i
i.r = j
f.z = j
f.r = j
n.y = k
n.p = d
n.o = j
n.r = b
assert e.w.z.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.o: E = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: F = None
        self.u: F = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.o: B = None
        self.z: C = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.txt = txt

b = A("b")
k = B("k")
e = C("e")
d = D("d")
j = E("j")
i = F("i")
f = G("f")
n = A("n")

b.y = k
b.p = d
b.o = j
b.r = n
k.v = i
k.s = i
k.u = i
k.o = i
k.r = n
e.w = f
d.u = k
d.o = k
d.v = f
d.z = e
d.q = i
d.r = n
j.q = n
j.r = i
i.r = j
f.z = j
f.r = j
n.y = k
n.p = d
n.o = j
n.r = b
assert e.w.z.r.r.r.r.r.txt == "i"