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

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

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

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

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

f = A("f")
h = B("h")
k = C("k")
g = D("g")
m = E("m")
i = B("i")
j = B("j")

f.p = g
f.o = m
f.q = k
h.z = f
h.w = f
h.v = k
h.r = m
k.y = g
k.p = m
g.w = m
m.t = k
m.v = k
m.w = i
i.z = f
i.w = f
i.v = k
i.r = m
j.z = f
j.w = f
j.v = k
j.r = m
assert h.z.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
k = C("k")
g = D("g")
m = E("m")
i = B("i")
j = B("j")

f.p = g
f.o = m
f.q = k
h.z = f
h.w = f
h.v = k
h.r = m
k.y = g
k.p = m
g.w = m
m.t = k
m.v = k
m.w = i
i.z = f
i.w = f
i.v = k
i.r = m
j.z = f
j.w = f
j.v = k
j.r = m
assert h.z.o.t.txt == "k"