class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: B = None
        self.w: G = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

c.o = l
c.r = g
c.w = i
c.p = i
g.p = i
g.u = a
k.z = l
f.r = c
f.p = n
f.s = n
f.w = n
f.t = l
f.z = g
f.q = g
a.t = n
l.w = a
l.q = f
i.t = f
n.r = c
n.p = f
n.s = f
n.w = f
n.t = l
n.z = g
n.q = g
b.o = l
b.r = g
b.w = i
b.p = i
assert g.u.t.r.w.t.t.w.t.txt == "n"