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

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

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

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

i = A("i")
b = B("b")
j = C("j")
g = D("g")

i.v = j
i.t = b
b.o = j
b.p = g
j.y = g
g.s = j
assert g.s.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.txt = txt

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

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

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

i = A("i")
b = B("b")
j = C("j")
g = D("g")

i.v = j
i.t = b
b.o = j
b.p = g
j.y = g
g.s = j
assert g.s.y.s.y.txt == "g"