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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

d = A("d")
i = B("i")
e = C("e")
l = D("l")
b = E("b")
a = F("a")
j = G("j")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.z: B = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.txt = txt

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

d = A("d")
i = B("i")
e = C("e")
l = D("l")
b = E("b")
a = F("a")
j = G("j")

d.r = a
i.t = j
e.p = b
e.z = d
e.v = a
l.u = d
l.v = d
l.w = j
l.z = i
b.z = l
b.u = d
b.x = e
b.p = a
a.s = l
a.z = l
j.q = a
j.y = l
j.s = i
assert i.t.s.t.s.t.txt == "j"