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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: D = None
        self.p: B = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
m = C("m")
a = D("a")
e = E("e")
c = F("c")
g = G("g")
h = H("h")
n = C("n")

b.p = c
b.q = l
b.v = e
b.x = g
b.t = g
b.o = n
l.x = b
l.o = g
m.x = a
m.p = n
m.u = n
m.t = l
m.o = c
a.s = g
e.u = b
e.q = l
c.u = h
c.s = a
c.p = l
c.y = e
c.w = e
g.w = b
h.w = e
n.x = a
n.p = m
n.u = m
n.t = l
n.o = c
assert n.o.p.o.w.p.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.v: E = None
        self.x: G = None
        self.t: G = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: D = None
        self.p: B = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
m = C("m")
a = D("a")
e = E("e")
c = F("c")
g = G("g")
h = H("h")
n = C("n")

b.p = c
b.q = l
b.v = e
b.x = g
b.t = g
b.o = n
l.x = b
l.o = g
m.x = a
m.p = n
m.u = n
m.t = l
m.o = c
a.s = g
e.u = b
e.q = l
c.u = h
c.s = a
c.p = l
c.y = e
c.w = e
g.w = b
h.w = e
n.x = a
n.p = m
n.u = m
n.t = l
n.o = c
assert n.o.p.o.w.p.p.x.txt == "b"