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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: D = None
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: D = None
        self.z: E = None
        self.w: C = None
        self.p: D = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: C = None
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: D = None
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: D = None
        self.z: E = None
        self.w: C = None
        self.p: D = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: C = None
        self.t: D = None
        self.w: D = None
        self.txt = txt

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

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