class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.p: F = None
        self.t: C = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.s: A = None
        self.w: B = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.p: B = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.s: A = None
        self.w: B = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.p: B = None
        self.r: A = None
        self.txt = txt

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

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

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