class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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