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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.t: A = None
        self.p: F = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.v: F = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: A = None
        self.t: A = None
        self.p: F = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: F = None
        self.v: F = None
        self.t: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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