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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: B = None
        self.t: B = None
        self.q: C = None
        self.v: F = None
        self.x: A = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: H = None
        self.t: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: H = None
        self.o: B = None
        self.w: A = None
        self.x: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: B = None
        self.t: B = None
        self.q: C = None
        self.v: F = None
        self.x: A = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: H = None
        self.t: C = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: H = None
        self.o: B = None
        self.w: A = None
        self.x: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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