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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: D = None
        self.txt = txt

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

g = A("g")
i = B("i")
k = C("k")
b = D("b")
h = E("h")
j = F("j")
l = G("l")
e = C("e")
f = E("f")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: D = None
        self.txt = txt

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

g = A("g")
i = B("i")
k = C("k")
b = D("b")
h = E("h")
j = F("j")
l = G("l")
e = C("e")
f = E("f")

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