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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: C = None
        self.q: E = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.y: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.y: D = None
        self.p: A = None
        self.s: C = None
        self.r: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: C = None
        self.q: E = None
        self.u: F = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.y: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: C = None
        self.y: D = None
        self.p: A = None
        self.s: C = None
        self.r: C = None
        self.q: G = None
        self.txt = txt

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

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

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

n.t = b
n.w = k
n.q = l
n.x = g
g.q = d
g.w = l
k.x = n
k.s = e
k.q = l
k.u = b
k.r = b
f.s = l
f.t = k
f.y = g
f.o = b
l.t = g
l.z = e
l.s = e
l.r = e
l.y = f
l.p = n
l.q = d
b.q = d
b.o = l
d.p = f
e.x = n
e.s = k
e.q = l
e.u = b
e.r = b
assert e.r.o.t.q.p.y.txt == "g"