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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: D = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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