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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.y: B = None
        self.z: G = None
        self.q: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: C = None
        self.x: C = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

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

c = A("c")
f = B("f")
a = C("a")
h = D("h")
m = E("m")
n = F("n")
k = G("k")
g = H("g")
j = E("j")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.y: B = None
        self.z: G = None
        self.q: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: C = None
        self.x: C = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

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

c = A("c")
f = B("f")
a = C("a")
h = D("h")
m = E("m")
n = F("n")
k = G("k")
g = H("g")
j = E("j")

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