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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: F = None
        self.w: A = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.q: C = None
        self.o: A = None
        self.txt = txt

g = A("g")
l = B("l")
d = C("d")
b = D("b")
k = E("k")
m = F("m")
j = G("j")
h = G("h")

g.o = h
l.s = k
l.p = b
l.y = g
l.z = j
d.v = g
b.p = h
b.o = m
b.w = g
b.u = j
k.x = d
m.s = j
m.v = l
j.z = h
j.s = b
j.q = d
j.o = g
h.z = j
h.s = b
h.q = d
h.o = g
assert l.s.x.v.o.s.o.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: F = None
        self.w: A = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: D = None
        self.q: C = None
        self.o: A = None
        self.txt = txt

g = A("g")
l = B("l")
d = C("d")
b = D("b")
k = E("k")
m = F("m")
j = G("j")
h = G("h")

g.o = h
l.s = k
l.p = b
l.y = g
l.z = j
d.v = g
b.p = h
b.o = m
b.w = g
b.u = j
k.x = d
m.s = j
m.v = l
j.z = h
j.s = b
j.q = d
j.o = g
h.z = j
h.s = b
h.q = d
h.o = g
assert l.s.x.v.o.s.o.v.p.txt == "b"