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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.o: A = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

h = A("h")
k = B("k")
j = C("j")
c = D("c")
a = E("a")
g = F("g")
i = G("i")
d = H("d")

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: E = None
        self.o: A = None
        self.w: A = None
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

h = A("h")
k = B("k")
j = C("j")
c = D("c")
a = E("a")
g = F("g")
i = G("i")
d = H("d")

h.t = d
k.v = j
k.p = d
k.s = g
j.x = g
c.s = g
c.z = a
c.o = h
c.w = h
c.x = h
a.x = h
a.y = d
a.t = j
g.w = d
g.p = c
i.v = j
d.z = k
d.r = g
d.o = a
assert g.p.z.x.t.z.txt == "k"