class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.w: G = None
        self.t: C = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: H = None
        self.w: F = None
        self.r: A = None
        self.t: D = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

f = A("f")
j = B("j")
g = C("g")
k = D("k")
c = E("c")
n = F("n")
m = G("m")
l = H("l")

f.x = n
f.s = n
f.v = l
f.w = m
f.t = g
j.p = m
j.y = m
j.v = m
j.x = l
j.w = n
j.r = f
j.t = k
g.p = m
k.y = m
k.x = m
c.y = f
c.p = n
n.z = k
m.o = k
l.r = c
l.v = n
l.o = k
assert f.w.o.y.o.x.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.w: G = None
        self.t: C = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: H = None
        self.w: F = None
        self.r: A = None
        self.t: D = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

f = A("f")
j = B("j")
g = C("g")
k = D("k")
c = E("c")
n = F("n")
m = G("m")
l = H("l")

f.x = n
f.s = n
f.v = l
f.w = m
f.t = g
j.p = m
j.y = m
j.v = m
j.x = l
j.w = n
j.r = f
j.t = k
g.p = m
k.y = m
k.x = m
c.y = f
c.p = n
n.z = k
m.o = k
l.r = c
l.v = n
l.o = k
assert f.w.o.y.o.x.o.y.txt == "m"