class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.t: A = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

g = A("g")
i = B("i")
c = C("c")
d = D("d")
b = E("b")
n = F("n")
a = A("a")
e = B("e")
f = E("f")
h = C("h")

g.p = d
i.p = d
i.u = b
i.t = g
i.s = a
i.x = f
c.q = h
c.s = n
d.y = f
d.t = b
b.t = n
b.q = n
b.v = g
b.x = g
n.o = h
n.q = d
n.t = a
a.p = d
e.p = d
e.u = b
e.x = b
e.t = a
e.s = a
f.t = n
f.q = n
f.v = a
f.x = a
h.q = c
h.s = n
assert n.o.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.t: A = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

g = A("g")
i = B("i")
c = C("c")
d = D("d")
b = E("b")
n = F("n")
a = A("a")
e = B("e")
f = E("f")
h = C("h")

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