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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: J = None
        self.w: E = None
        self.y: E = None
        self.p: H = None
        self.s: F = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.z: C = None
        self.r: H = None
        self.x: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: E = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: H = None
        self.p: J = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: J = None
        self.w: E = None
        self.y: E = None
        self.p: H = None
        self.s: F = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.z: C = None
        self.r: H = None
        self.x: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: E = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: H = None
        self.p: J = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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