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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: G = None
        self.r: E = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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

n.t = g
i.q = n
i.x = g
i.r = m
i.t = e
d.w = m
d.y = m
d.q = i
d.p = i
d.t = i
d.v = g
d.x = l
e.z = i
e.o = i
e.y = g
m.y = n
m.p = d
m.w = l
l.q = m
l.o = g
g.y = i
g.u = i
b.z = i
b.o = i
b.y = g
assert b.o.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: G = None
        self.r: E = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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

n.t = g
i.q = n
i.x = g
i.r = m
i.t = e
d.w = m
d.y = m
d.q = i
d.p = i
d.t = i
d.v = g
d.x = l
e.z = i
e.o = i
e.y = g
m.y = n
m.p = d
m.w = l
l.q = m
l.o = g
g.y = i
g.u = i
b.z = i
b.o = i
b.y = g
assert b.o.r.y.txt == "n"