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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.z: C = None
        self.s: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: A = None
        self.o: D = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

h = A("h")
g = B("g")
k = C("k")
b = D("b")
a = E("a")
f = A("f")
c = E("c")
i = B("i")

h.r = b
h.y = k
g.x = k
g.r = k
g.z = k
g.p = k
g.s = a
k.x = i
k.u = h
k.o = b
k.w = a
k.y = f
b.w = a
b.v = h
b.q = f
a.z = b
a.p = i
a.u = k
a.o = k
f.r = b
f.y = k
c.z = b
c.p = i
c.u = k
c.o = k
i.x = k
i.r = k
i.z = k
i.p = k
i.s = a
assert f.y.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.z: C = None
        self.s: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: A = None
        self.o: D = None
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

h = A("h")
g = B("g")
k = C("k")
b = D("b")
a = E("a")
f = A("f")
c = E("c")
i = B("i")

h.r = b
h.y = k
g.x = k
g.r = k
g.z = k
g.p = k
g.s = a
k.x = i
k.u = h
k.o = b
k.w = a
k.y = f
b.w = a
b.v = h
b.q = f
a.z = b
a.p = i
a.u = k
a.o = k
f.r = b
f.y = k
c.z = b
c.p = i
c.u = k
c.o = k
i.x = k
i.r = k
i.z = k
i.p = k
i.s = a
assert f.y.u.r.txt == "b"