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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.p: E = None
        self.o: A = None
        self.y: C = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.v: C = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

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

m.u = k
m.s = j
d.w = g
g.v = k
g.y = d
g.s = m
g.p = m
g.u = j
b.u = l
l.u = m
l.t = m
l.v = b
l.s = g
j.v = g
j.y = g
j.u = m
j.o = m
j.s = m
j.t = m
j.p = l
k.s = j
k.q = j
k.o = d
k.v = g
k.u = g
assert j.y.p.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.p: E = None
        self.o: A = None
        self.y: C = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.v: C = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

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

m.u = k
m.s = j
d.w = g
g.v = k
g.y = d
g.s = m
g.p = m
g.u = j
b.u = l
l.u = m
l.t = m
l.v = b
l.s = g
j.v = g
j.y = g
j.u = m
j.o = m
j.s = m
j.t = m
j.p = l
k.s = j
k.q = j
k.o = d
k.v = g
k.u = g
assert j.y.p.s.v.txt == "g"