class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.w: B = None
        self.t: G = None
        self.q: F = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

d.p = k
d.t = k
d.o = c
d.w = c
d.q = g
d.y = f
c.s = g
c.o = b
i.x = j
i.t = n
i.o = c
j.v = g
j.x = k
j.t = c
n.u = d
n.o = d
g.t = j
g.s = j
k.q = d
h.y = n
f.x = j
f.t = n
f.o = b
b.s = g
b.o = c
assert i.x.t.s.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.w: B = None
        self.t: G = None
        self.q: F = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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