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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: C = None
        self.u: G = None
        self.t: F = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: C = None
        self.u: G = None
        self.t: F = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

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

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

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