class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.w: C = None
        self.z: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: F = None
        self.r: A = None
        self.p: B = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: F = None
        self.r: A = None
        self.p: B = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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