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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: A = None
        self.r: F = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

e.z = c
e.v = k
k.w = m
k.u = m
j.t = k
c.u = h
c.r = h
m.s = h
m.p = h
m.r = b
b.p = c
h.w = j
h.x = j
h.v = e
h.s = e
h.r = b
assert c.r.s.v.u.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: A = None
        self.r: F = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

e.z = c
e.v = k
k.w = m
k.u = m
j.t = k
c.u = h
c.r = h
m.s = h
m.p = h
m.r = b
b.p = c
h.w = j
h.x = j
h.v = e
h.s = e
h.r = b
assert c.r.s.v.u.r.p.txt == "c"