class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.y: G = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.r: F = None
        self.q: G = None
        self.t: F = None
        self.s: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.y: G = None
        self.x: F = None
        self.u: F = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.y: D = None
        self.z: B = None
        self.r: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.r: F = None
        self.q: G = None
        self.t: F = None
        self.s: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.y: G = None
        self.x: F = None
        self.u: F = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.y: D = None
        self.z: B = None
        self.r: D = None
        self.v: G = None
        self.txt = txt

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

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

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

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