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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: G = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.z: A = None
        self.r: G = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: G = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.z: A = None
        self.r: G = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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