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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: D = None
        self.v: D = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

e = A("e")
i = B("i")
j = C("j")
g = D("g")
h = E("h")

e.y = g
e.r = g
e.z = j
e.x = j
i.o = j
i.r = g
i.y = g
j.p = g
j.s = g
j.v = g
j.z = e
j.w = i
g.s = j
g.p = i
h.q = g
assert e.z.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.z: C = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: D = None
        self.v: D = None
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

e = A("e")
i = B("i")
j = C("j")
g = D("g")
h = E("h")

e.y = g
e.r = g
e.z = j
e.x = j
i.o = j
i.r = g
i.y = g
j.p = g
j.s = g
j.v = g
j.z = e
j.w = i
g.s = j
g.p = i
h.q = g
assert e.z.v.p.txt == "i"