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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.r: B = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.q: F = None
        self.o: B = None
        self.y: E = None
        self.txt = txt

c = A("c")
i = B("i")
a = C("a")
f = D("f")
g = E("g")
b = F("b")
j = G("j")
k = H("k")
l = H("l")

c.w = f
c.s = b
i.u = b
i.r = j
i.x = a
a.t = g
a.w = g
a.v = i
a.r = i
f.x = g
f.s = l
g.w = f
b.v = g
b.y = c
j.q = c
k.t = f
k.u = a
k.q = b
k.o = i
k.y = g
l.t = f
l.u = a
l.q = b
l.o = i
l.y = g
assert f.s.o.x.r.u.v.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: B = None
        self.r: B = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.q: F = None
        self.o: B = None
        self.y: E = None
        self.txt = txt

c = A("c")
i = B("i")
a = C("a")
f = D("f")
g = E("g")
b = F("b")
j = G("j")
k = H("k")
l = H("l")

c.w = f
c.s = b
i.u = b
i.r = j
i.x = a
a.t = g
a.w = g
a.v = i
a.r = i
f.x = g
f.s = l
g.w = f
b.v = g
b.y = c
j.q = c
k.t = f
k.u = a
k.q = b
k.o = i
k.y = g
l.t = f
l.u = a
l.q = b
l.o = i
l.y = g
assert f.s.o.x.r.u.v.w.x.txt == "g"