class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: C = None
        self.r: A = None
        self.z: D = None
        self.x: H = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: F = None
        self.r: E = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: C = None
        self.r: A = None
        self.z: D = None
        self.x: H = None
        self.q: C = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: F = None
        self.r: E = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

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

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

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