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

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

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

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

f = A("f")
h = B("h")
l = C("l")
e = D("e")
j = D("j")

f.v = h
f.u = l
f.q = l
f.w = e
h.q = l
h.y = e
h.w = f
l.q = f
l.o = h
e.s = f
e.p = h
e.q = h
e.u = j
j.s = f
j.p = h
j.q = h
j.u = e
assert j.q.y.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
l = C("l")
e = D("e")
j = D("j")

f.v = h
f.u = l
f.q = l
f.w = e
h.q = l
h.y = e
h.w = f
l.q = f
l.o = h
e.s = f
e.p = h
e.q = h
e.u = j
j.s = f
j.p = h
j.q = h
j.u = e
assert j.q.y.u.u.txt == "e"