class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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