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

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

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

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.q: G = None
        self.o: G = None
        self.y: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.q: G = None
        self.o: G = None
        self.y: C = None
        self.u: G = None
        self.txt = txt

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

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