class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: C = None
        self.s: F = None
        self.z: F = None
        self.p: H = None
        self.u: B = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.t: H = None
        self.w: A = None
        self.z: D = None
        self.v: H = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: A = None
        self.t: H = None
        self.w: A = None
        self.z: D = None
        self.v: H = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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