class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: C = None
        self.o: C = None
        self.x: C = None
        self.y: E = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: D = None
        self.q: H = None
        self.r: E = None
        self.t: H = None
        self.y: A = None
        self.o: D = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

d.w = g
d.z = k
d.o = k
d.x = k
d.y = b
d.r = l
l.y = f
k.u = e
k.p = e
k.o = f
k.w = c
k.z = d
i.q = l
b.o = d
b.v = i
c.u = d
c.y = d
c.w = i
c.o = i
c.q = g
c.t = g
c.r = b
c.s = e
e.y = k
e.p = c
g.t = k
f.u = d
f.y = d
f.w = i
f.o = i
f.q = g
f.t = g
f.r = b
f.s = e
assert f.r.v.q.y.o.q.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: C = None
        self.o: C = None
        self.x: C = None
        self.y: E = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: D = None
        self.q: H = None
        self.r: E = None
        self.t: H = None
        self.y: A = None
        self.o: D = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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