class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.txt = txt

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

g = A("g")
m = B("m")
n = C("n")
f = D("f")
k = E("k")
a = F("a")
b = G("b")
j = B("j")

g.o = f
g.w = j
g.p = n
m.t = b
m.o = b
m.s = k
m.r = k
m.y = k
m.u = f
m.p = g
n.z = k
n.u = f
f.v = g
k.w = g
k.z = b
a.x = f
a.w = m
b.x = f
b.o = g
b.w = a
b.u = k
j.t = b
j.o = b
j.s = k
j.r = k
j.y = k
j.u = f
j.p = g
assert b.o.o.v.w.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.txt = txt

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

g = A("g")
m = B("m")
n = C("n")
f = D("f")
k = E("k")
a = F("a")
b = G("b")
j = B("j")

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