class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

c = A("c")
g = B("g")
k = C("k")
i = D("i")

c.t = g
c.z = g
c.s = g
c.u = g
g.v = k
g.y = i
k.y = i
k.x = i
k.q = g
k.w = c
i.w = c
assert c.t.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

c = A("c")
g = B("g")
k = C("k")
i = D("i")

c.t = g
c.z = g
c.s = g
c.u = g
g.v = k
g.y = i
k.y = i
k.x = i
k.q = g
k.w = c
i.w = c
assert c.t.v.y.txt == "i"