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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

n = A("n")
g = B("g")
k = C("k")
d = D("d")
j = E("j")
f = F("f")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: E = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

n = A("n")
g = B("g")
k = C("k")
d = D("d")
j = E("j")
f = F("f")
c = F("c")

n.v = g
g.t = j
k.u = f
k.r = g
d.z = j
j.t = k
j.u = k
j.y = c
f.y = j
f.s = j
f.v = j
f.z = k
c.y = j
c.s = j
c.v = j
c.z = k
assert g.t.u.r.t.txt == "j"