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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.p: B = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

m = A("m")
f = B("f")
j = C("j")
g = D("g")
k = E("k")
b = F("b")
n = G("n")
a = C("a")

m.r = j
m.v = g
m.s = a
m.p = a
f.y = k
f.r = g
f.v = m
j.s = a
j.u = m
g.y = m
g.u = m
k.u = m
k.y = m
k.x = a
k.t = a
b.q = m
b.z = m
b.v = j
b.p = f
b.x = g
n.r = g
n.t = k
a.s = j
a.u = m
assert g.u.v.u.p.u.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: D = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.p: B = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

m = A("m")
f = B("f")
j = C("j")
g = D("g")
k = E("k")
b = F("b")
n = G("n")
a = C("a")

m.r = j
m.v = g
m.s = a
m.p = a
f.y = k
f.r = g
f.v = m
j.s = a
j.u = m
g.y = m
g.u = m
k.u = m
k.y = m
k.x = a
k.t = a
b.q = m
b.z = m
b.v = j
b.p = f
b.x = g
n.r = g
n.t = k
a.s = j
a.u = m
assert g.u.v.u.p.u.s.s.txt == "j"