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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: E = None
        self.v: A = None
        self.w: F = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

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

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

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

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

h = A("h")
m = B("m")
a = C("a")
c = D("c")
i = E("i")
n = F("n")
d = G("d")
b = F("b")
g = A("g")
j = C("j")

h.t = c
h.o = n
m.y = n
m.o = h
m.t = d
m.x = c
a.y = c
a.t = i
a.v = g
a.w = b
a.x = d
a.z = d
c.u = m
i.p = h
i.y = d
n.x = c
d.v = g
b.x = c
g.t = c
g.o = n
j.y = c
j.t = i
j.v = h
j.w = n
j.x = d
j.z = d
assert i.y.v.t.u.y.x.u.t.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: E = None
        self.v: A = None
        self.w: F = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

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

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

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

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

h = A("h")
m = B("m")
a = C("a")
c = D("c")
i = E("i")
n = F("n")
d = G("d")
b = F("b")
g = A("g")
j = C("j")

h.t = c
h.o = n
m.y = n
m.o = h
m.t = d
m.x = c
a.y = c
a.t = i
a.v = g
a.w = b
a.x = d
a.z = d
c.u = m
i.p = h
i.y = d
n.x = c
d.v = g
b.x = c
g.t = c
g.o = n
j.y = c
j.t = i
j.v = h
j.w = n
j.x = d
j.z = d
assert i.y.v.t.u.y.x.u.t.v.o.txt == "n"