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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: D = None
        self.q: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: D = None
        self.q: A = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

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

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

d.x = j
d.q = j
d.w = c
d.s = n
m.y = h
m.z = f
n.t = h
n.s = j
n.w = j
n.o = k
n.r = g
n.z = d
g.x = k
g.p = b
g.q = d
g.y = h
c.u = d
j.r = f
j.o = b
j.u = h
h.p = g
b.x = m
b.p = g
b.q = d
b.y = h
k.y = h
k.z = n
f.t = h
f.s = j
f.w = j
f.o = m
f.r = g
f.z = d
assert n.z.w.u.s.t.p.txt == "g"