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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: D = None
        self.v: F = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: B = None
        self.o: G = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

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

k.o = e
f.y = l
f.u = c
f.v = b
a.u = m
c.p = f
c.x = e
c.r = k
l.t = f
l.r = c
l.o = c
l.v = m
l.u = b
m.p = a
m.x = k
e.o = f
n.r = b
n.t = f
n.o = e
n.x = e
n.w = a
b.r = n
b.t = f
b.o = e
b.x = e
b.w = a
assert a.u.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: D = None
        self.v: F = None
        self.o: D = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: B = None
        self.o: G = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

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

k.o = e
f.y = l
f.u = c
f.v = b
a.u = m
c.p = f
c.x = e
c.r = k
l.t = f
l.r = c
l.o = c
l.v = m
l.u = b
m.p = a
m.x = k
e.o = f
n.r = b
n.t = f
n.o = e
n.x = e
n.w = a
b.r = n
b.t = f
b.o = e
b.x = e
b.w = a
assert a.u.p.u.txt == "m"