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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.v: E = None
        self.z: D = None
        self.x: B = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.txt = txt

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

i = A("i")
g = B("g")
j = C("j")
k = D("k")
b = E("b")
h = F("h")
c = G("c")
a = F("a")
m = D("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.v: E = None
        self.z: D = None
        self.x: B = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: D = None
        self.txt = txt

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

i = A("i")
g = B("g")
j = C("j")
k = D("k")
b = E("b")
h = F("h")
c = G("c")
a = F("a")
m = D("m")

i.u = g
i.o = m
g.t = c
g.o = i
j.x = b
j.u = k
k.t = i
k.o = a
k.v = b
k.z = m
k.w = m
k.x = g
k.y = g
b.u = i
b.o = g
h.v = j
h.y = k
c.p = i
a.v = j
a.y = k
m.t = i
m.o = a
m.v = b
m.z = k
m.w = k
m.x = g
m.y = g
assert g.o.o.z.v.u.o.o.v.x.txt == "b"