class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: B = None
        self.y: H = None
        self.r: F = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.p: E = None
        self.y: E = None
        self.q: G = None
        self.s: D = None
        self.t: D = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.v: C = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

f = A("f")
n = B("n")
b = C("b")
k = D("k")
c = E("c")
d = F("d")
m = G("m")
h = H("h")
l = B("l")
e = G("e")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.p: E = None
        self.y: E = None
        self.q: G = None
        self.s: D = None
        self.t: D = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.v: C = None
        self.s: B = None
        self.o: E = None
        self.txt = txt

f = A("f")
n = B("n")
b = C("b")
k = D("k")
c = E("c")
d = F("d")
m = G("m")
h = H("h")
l = B("l")
e = G("e")

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