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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

e = A("e")
f = B("f")
i = C("i")
g = D("g")
b = B("b")
h = B("h")
n = B("n")
j = A("j")
c = D("c")

e.x = i
e.p = c
f.o = i
f.r = b
f.x = e
f.t = e
i.w = f
g.w = c
g.y = c
g.v = i
b.o = i
b.r = h
b.x = e
b.t = j
h.o = i
h.r = b
h.x = j
h.t = j
n.o = i
n.r = b
n.x = j
n.t = j
j.x = i
j.p = g
c.w = g
c.y = g
c.v = i
assert c.y.v.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

e = A("e")
f = B("f")
i = C("i")
g = D("g")
b = B("b")
h = B("h")
n = B("n")
j = A("j")
c = D("c")

e.x = i
e.p = c
f.o = i
f.r = b
f.x = e
f.t = e
i.w = f
g.w = c
g.y = c
g.v = i
b.o = i
b.r = h
b.x = e
b.t = j
h.o = i
h.r = b
h.x = j
h.t = j
n.o = i
n.r = b
n.x = j
n.t = j
j.x = i
j.p = g
c.w = g
c.y = g
c.v = i
assert c.y.v.w.o.txt == "i"