class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: A = None
        self.t: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

k = A("k")
h = B("h")
n = C("n")
g = D("g")
c = E("c")
f = F("f")
l = D("l")
i = F("i")

k.u = h
k.q = i
k.z = i
h.s = k
h.t = i
h.z = g
n.w = h
g.w = n
g.z = n
g.t = c
g.s = c
c.o = i
c.w = k
c.t = k
c.y = k
f.s = c
l.w = n
l.z = n
l.t = c
l.s = c
i.s = c
assert g.z.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: F = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: A = None
        self.t: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

k = A("k")
h = B("h")
n = C("n")
g = D("g")
c = E("c")
f = F("f")
l = D("l")
i = F("i")

k.u = h
k.q = i
k.z = i
h.s = k
h.t = i
h.z = g
n.w = h
g.w = n
g.z = n
g.t = c
g.s = c
c.o = i
c.w = k
c.t = k
c.y = k
f.s = c
l.w = n
l.z = n
l.t = c
l.s = c
i.s = c
assert g.z.w.t.txt == "i"