class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

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

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

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

b = A("b")
f = B("f")
c = C("c")
d = D("d")
e = E("e")
l = C("l")
g = A("g")
j = E("j")
a = A("a")
h = D("h")

b.w = e
b.u = f
f.z = h
f.w = e
f.r = d
c.p = a
c.q = f
c.y = l
d.p = h
e.y = b
e.q = b
e.t = f
e.s = j
e.v = l
l.p = g
l.q = f
l.y = c
g.w = j
g.u = f
j.y = a
j.q = g
j.t = f
j.s = e
j.v = l
a.w = j
a.u = f
h.p = d
assert f.w.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

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

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

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

b = A("b")
f = B("f")
c = C("c")
d = D("d")
e = E("e")
l = C("l")
g = A("g")
j = E("j")
a = A("a")
h = D("h")

b.w = e
b.u = f
f.z = h
f.w = e
f.r = d
c.p = a
c.q = f
c.y = l
d.p = h
e.y = b
e.q = b
e.t = f
e.s = j
e.v = l
l.p = g
l.q = f
l.y = c
g.w = j
g.u = f
j.y = a
j.q = g
j.t = f
j.s = e
j.v = l
a.w = j
a.u = f
h.p = d
assert f.w.y.u.txt == "f"