class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.w: B = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.w: B = None
        self.z: F = None
        self.txt = txt

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

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

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