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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: F = None
        self.q: B = None
        self.w: G = None
        self.v: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: F = None
        self.q: B = None
        self.w: G = None
        self.v: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

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