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

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

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

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

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

e.y = m
e.p = h
f.v = m
f.s = d
f.w = n
b.q = f
b.v = m
i.z = c
i.y = c
i.v = e
h.y = m
h.p = e
d.z = c
d.y = c
d.v = e
n.v = m
n.s = i
n.w = f
j.q = f
j.v = m
c.z = d
c.y = d
c.v = h
m.q = f
m.v = j
assert j.q.v.q.v.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

e.y = m
e.p = h
f.v = m
f.s = d
f.w = n
b.q = f
b.v = m
i.z = c
i.y = c
i.v = e
h.y = m
h.p = e
d.z = c
d.y = c
d.v = e
n.v = m
n.s = i
n.w = f
j.q = f
j.v = m
c.z = d
c.y = d
c.v = h
m.q = f
m.v = j
assert j.q.v.q.v.v.q.txt == "f"