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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.y: D = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: E = None
        self.t: C = None
        self.u: F = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.p: C = None
        self.r: D = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: G = None
        self.txt = txt

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

f.x = g
f.p = j
i.v = b
j.t = i
j.z = f
j.y = b
j.p = b
j.v = h
b.z = f
b.o = f
b.p = k
b.t = j
b.u = g
b.v = g
e.z = k
e.v = b
e.r = b
e.s = b
e.p = h
e.o = g
g.r = i
g.o = j
d.u = e
d.v = l
l.u = e
l.v = d
h.t = i
h.z = f
h.y = b
h.p = b
h.v = j
k.z = e
k.v = b
k.r = b
k.s = b
k.p = h
k.o = g
assert j.y.z.p.y.u.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.y: D = None
        self.v: C = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: E = None
        self.t: C = None
        self.u: F = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.p: C = None
        self.r: D = None
        self.o: F = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: G = None
        self.txt = txt

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

f.x = g
f.p = j
i.v = b
j.t = i
j.z = f
j.y = b
j.p = b
j.v = h
b.z = f
b.o = f
b.p = k
b.t = j
b.u = g
b.v = g
e.z = k
e.v = b
e.r = b
e.s = b
e.p = h
e.o = g
g.r = i
g.o = j
d.u = e
d.v = l
l.u = e
l.v = d
h.t = i
h.z = f
h.y = b
h.p = b
h.v = j
k.z = e
k.v = b
k.r = b
k.s = b
k.p = h
k.o = g
assert j.y.z.p.y.u.o.p.txt == "b"